<?php

class Admin_Model_Shortcut extends Admin_Model_TreeNode{
	public $ShortcutId;
    public $MenuTitle;
    private $_Reference;
    
    public function __sleep(){
        $a = parent::__sleep();
        $a[] = 'ShortcutId';
        return $a;
    }
    
    public function setShortcutId($v){$this->ShortcutId = $v;return $this;}
    public function getShortcutId(){return $this->ShortcutId;}
    public function getMenuTitle(){return $this->getNode()->getMenuTitle();}
    public function getURL(){return $this->getNode()->getURL();}
    
    public function getNode(){
        if (null != $this->_Reference) return $this->_Reference;
        $m = new Admin_Model_TreeNodeMapper();
        $this->_Reference = $m->find($this->getShortcutId());
        return $this->_Reference;
    }
    
    public function __call($name, $arguments){
        if (!method_exists($this->getNode(),$name))
                throw new Zend_Exception("Method ".$name." doesn't exist");
        //echo $name;
        $this->getNode()->$name();
    }
    
    /*public function render($options=null){
		return $this->replaceTags(
				$this->prepareLinks(
						$this->getHTML()
					)
				);
    }*/
}

?>